Adaptive dimmer detection and control for led lamp

ABSTRACT

An LED lamp is provided in which the output light intensity of the LEDs in the LED lamp is adjusted based on the input voltage to the LED lamp. A dimmer control unit detects a type of dimmer switch during a configuration process. Using the detected dimmer type, the dimmer control unit generates control signals appropriate for the detected dimmer type to provide regulated current to the LEDs and to achieve the desired dimming effect. The LED lamp can be a direct replacement of conventional incandescent lamps in typical wiring configurations found in residential and commercial building lighting applications that use conventional dimmer switches.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to driving LED (Light-Emitting Diode)lamps and, more specifically, to dimming the LED lamps.

2. Description of the Related Arts

LEDs are being adopted in a wide variety of electronics applications,for example, architectural lighting, automotive head and tail lights,backlights for liquid crystal display devices, flashlights, etc.Compared to conventional lighting sources such as incandescent lamps andfluorescent lamps, LEDs have significant advantages, including highefficiency, good directionality, color stability, high reliability, longlife time, small size, and environmental safety.

The use of LEDs in lighting applications is expected to expand, as theyprovide significant advantages over incandescent lamps (light bulbs) inpower efficiency (lumens per watt) and spectral quality. Furthermore,LED lamps represent lower environmental impact compared to fluorescentlighting systems (fluorescent ballast combined with fluorescent lamp)that may cause mercury contamination as a result of fluorescent lampdisposal.

However, conventional LED lamps cannot be direct replacements ofincandescent lamps and dimmable fluorescent systems withoutmodifications to current wiring and component infrastructure that havebeen built around incandescent light bulbs. This is because conventionalincandescent lamps are voltage driven devices, while LEDs are currentdriven devices, requiring different techniques for controlling theintensity of their respective light outputs.

FIG. 1 illustrates a typical dimmer wiring configuration in conventionalresidential and commercial lighting applications. Predominantly,incandescent lamps operate off of alternating current (AC) systems.Specifically, a dimmer switch 10 is placed in series with an inputvoltage source 15 and the incandescent lamp 20. The dimmer switch 10receives a dimming input signal 25, which sets the desired light outputintensity of incandescent lamp 20. Control of light intensity of theincandescent lamp 20 is achieved by adjusting the RMS voltage value ofthe lamp input voltage (V-RMS) 30 that is applied to incandescent lamp20. Dimming input signal 25 can either be provided manually (via a knobor slider switch) or via an automated lighting control system.

Many dimmer switches adjust the V-RMS by controlling the phase angle ofthe AC-input power that is applied to the incandescent lamp to dim theincandescent lamp. FIGS. 2A, 2B, and 2C illustrate typical lamp inputvoltage waveforms which are output to incandescent lamp 20. FIG. 2Aillustrates a typical lamp input voltage waveform 30 when no dimmingswitch 10 is present, or when the dimmer switch 10 is set to maximumlight intensity and the voltage signal from the input voltage source 15is unaffected by the dimmer switch 10. FIG. 2B illustrates lamp inputvoltage 30 with a dimming effect based on leading edge phase anglemodulation (i.e. a leading edge dimmer). In a leading edge dimmer, thedimmer switch 10 eliminates a section 32 having a period Td_off of thelamp input voltage 30 after the zero-crossings of the AC half-cycles andbefore the peaks. The input voltage 30 is unchanged during the periodTd_on. As the dimming input signal 25 increases the desired dimmingeffect, the period Td_off of the eliminated section 32 increases, theperiod Td_on decreases, and the output light intensity decreases. Forminimum dimming (maximum light intensity), the period Td_off of theeliminated section 32 becomes very small or zero.

FIG. 2C illustrates lamp input voltage 30 with a dimming effect based ontrailing edge phase angle modulation (i.e. a trailing edge dimmer).Trailing edge dimmer switches operate by removing trailing portions 34of AC voltage half-cycles, after peaks and before zero-crossings. Theinput voltage 30 is unchanged during the period Td_on. Again, as thedimming input signal 25 increases the desired dimming effect, the periodTd_off of the removed sections 34 increases, the period Td_on decreases,and the light intensity decreases. For minimum dimming (maximum lightintensity) the period Td_off of the eliminated section 34 becomes verysmall or zero.

Controlling the phase angle is a very effective and simple way to adjustthe RMS-voltage supplied to the incandescent bulb and provide dimmingcapabilities. However, conventional dimmer switches that control thephase angle of the input voltage are not compatible with conventionalLED lamps, since LEDs, and thus LED lamps, are current driven devices.

One solution to this compatibility problem uses an LED driver thatsenses the lamp input voltage 30 to determine the operating duty cycleof the dimmer switch 10 and reduces the regulated forward currentthrough an LED lamp as the operating duty cycle of the dimmer switch 10is lowered. However, the control methods employed in these conventionalsolutions are compatible with only a single type of dimming switch,e.g., leading edge or trailing edge. If an LED lamp designed for usewith a leading edge dimmer switch is connected to a lamp input voltage30 using a trailing edge dimmer switch or vice versa, the LED lamp willlikely malfunction and/or fail.

SUMMARY OF THE INVENTION

In a first aspect of the present invention, embodiments comprise alight-emitting diode (LED) lamp having one or more LEDs, a dimmercontrol unit, and a power converter. The dimmer control determines atype of dimmer switch providing an input voltage, determines a detecteddimming amount of the input voltage for the detected type of dimmer, andgenerates one or more control signals to control regulated currentthrough the LEDs such that an output light intensity of the LEDs isproportional to the detected dimming amount. The power converterreceives the control signals and provides regulated current to the LEDs.The power converter adjusts the regulated current to the LEDs asindicated by the control signals to achieve the output light intensityproportional to the detected dimming amount.

In one embodiment, the dimmer control unit comprises a phase detectorthat determines a detected phase angle modulation of the input voltagerepresentative of the detected dimming amount. The phase detector usesthe detected dimmer type to determine threshold values and compares thethreshold values to the input voltage to determine the phase anglemodulation. A chop generator circuit uses the detected phase anglemodulation to generate a chopping control signal that controls switchingof a chopping circuit for efficiently providing supply power to thepower converter. A dimming controller uses the detected phase anglemodulation to generate control signals for controlling switching of thepower converter to achieve the desired dimming effect.

In a second aspect of the present invention, a method determines a typeof dimmer switch coupled to the LED lamp. In a first detection stage, adimmer type detector receives a lamp input voltage and computes amaximum derivative of the lamp input voltage that occurred during aprevious cycle. The dimmer type detector also computes a first thresholdvalue. If the maximum derivative exceeds the first threshold value, thedimmer type detector determines that the input voltage is outputted froma leading edge dimmer switch. If the threshold is not exceeded, thedimmer type detector determines a time period during which the lampinput voltage remains below a trailing edge threshold value. The dimmertype detector determines that the input voltage is outputted from atrailing edge dimmer switch responsive to the time period exceeding apredefined time threshold. Otherwise, the dimmer type detectordetermines that the input voltage is not outputted from a dimmer switch.

In one embodiment, a second detection stage is performed a number ofcycles after the first detection stage. If the results of the first andsecond detection stages do not match, a third detection stage isperformed after another number of cycles. If the results from the secondand third detection stages match, then the dimmer type is set to matchthe results from the second and third stages. If the results do notmatch, the dimmer type detector outputs a signal indicative of anunsupported dimmer type.

The LED lamp according to various embodiments of the present inventionhas the advantage that the LED lamp can be a direct replacement ofconventional incandescent lamps in typical wiring configurations foundin residential and commercial building lighting applications, and thatthe LED lamp can be used with conventional dimmer switches that carryout dimming by changing the input voltage.

The features and advantages described in the specification are not allinclusive and, in particular, many additional features and advantageswill be apparent to one of ordinary skill in the art in view of thedrawings, specification, and claims. Moreover, it should be noted thatthe language used in the specification has been principally selected forreadability and instructional purposes, and may not have been selectedto delineate or circumscribe the inventive subject matter.

BRIEF DESCRIPTION OF THE DRAWINGS

The teachings of the embodiments of the present invention can be readilyunderstood by considering the following detailed description inconjunction with the accompanying drawings.

Figure (FIG.) 1 illustrates a typical dimmer wiring configuration inconventional residential and commercial lighting applications.

FIGS. 2A, 2B, and 2C illustrate typical lamp input voltage waveformswhich are output by different types of dimming switches.

FIG. 3 illustrates an LED lamp system including an LED lamp according toone embodiment of the present invention, used with a conventional dimmerswitch.

FIG. 4 illustrates a circuit of a conventional dimmer switch.

FIG. 5 illustrates an LED lamp circuit according to one embodiment ofthe present invention.

FIG. 6 illustrates waveforms showing operation of a chopping circuit,according to one embodiment of the present invention.

FIG. 7 illustrates a dimmer control unit, according to one embodiment ofthe present invention.

FIG. 8 is a flowchart illustrating a process for detecting a dimmertype, according to one embodiment of the present invention.

FIG. 9 is a flowchart illustrating a multi-stage process for detectingand re-detecting a dimmer type, according to one embodiment of thepresent invention.

FIGS. 10A and 10B illustrate waveforms showing the detected period andon-time of a lamp input voltage according to one embodiment of thepresent invention.

DETAILED DESCRIPTION OF EMBODIMENTS

The Figures (FIG.) and the following description relate to preferredembodiments of the present invention by way of illustration only. Itshould be noted that from the following discussion, alternativeembodiments of the structures and methods disclosed herein will bereadily recognized as viable alternatives that may be employed withoutdeparting from the principles of the claimed invention.

Reference will now be made in detail to several embodiments of thepresent invention(s), examples of which are illustrated in theaccompanying figures. It is noted that wherever practicable similar orlike reference numbers may be used in the figures and may indicatesimilar or like functionality. The figures depict embodiments of thepresent invention for purposes of illustration only. One skilled in theart will readily recognize from the following description thatalternative embodiments of the structures and methods illustrated hereinmay be employed without departing from the principles of the inventiondescribed herein.

As will be explained in more detail below with reference to the figures,the LED lamp system and a method according to various embodiments of thepresent invention (1) detects an input voltage from a dimming circuitand determines the type of dimming system (i.e., leading edge dimmer,trailing edge dimmer, no dimmer, or unsupported dimmer); (2) generatesdimming control signals based on the input voltage and the determineddimming type; and (3) provides corresponding output drive current to theLEDs in the LED lamp based on the dimming control signals to achieve thedesired light intensity of the LEDs. In addition, the LED lamp systemmay go into a “safe mode” when the system is unable to identify the typeof dimming system, or when the detected dimming type is unsupported.Thus the LED lamp beneficially detects the type of dimming switchemployed, and adjust its control to be compatible with the detecteddimming type such that the LED lamp can directly replace an incandescentlamp in a typical wiring configuration.

FIG. 3 illustrates an LED lamp system including LED lamp 300 used with aconventional dimmer switch 10. LED lamp 300 according to variousembodiments of the present invention is a direct replacement of anincandescent lamp 20 in a conventional dimmer switch setting, such asthe setting of FIG. 1. A dimmer switch 10 is placed in series with ACinput voltage source 15 and LED lamp 300. Dimmer switch 10 is aconventional one, an example of which will be described in more detailbelow with reference to FIG. 4. Dimmer switch 10 receives a dimminginput signal 25, which is used to set the desired light output intensityof LED lamp 300. Dimmer switch 10 receives AC input voltage signal 82and adjusts the V-RMS value of lamp input voltage 84 in response todimming input signal 25. In other words, control of the light intensityoutputted by LED lamp 300 by dimmer switch 10 is achieved by adjustingthe V-RMS value of the lamp input voltage 84 that is applied to LED lamp300, in a conventional manner. The LED lamp 300 controls the lightoutput intensity of LED lamp 300 to vary proportionally to the lampinput voltage 84, exhibiting behavior similar to incandescent lamps,even though LEDs are current-driven devices and not voltage drivendevices. Furthermore, LED lamp 300 can detect the type of dimmer switch10 (e.g., leading edge, trailing edge, no dimmer, or unsupported dimmer)and adjust internal controls so that LED lamp 300 is compatible with thedetected type. Dimming input signal 25 can either be provided manually(via a knob or slider switch, not shown herein) or via an automatedlighting control system (not shown herein).

Dimmer Switch

FIG. 4 illustrates the circuit of a conventional dimmer switch 10 foruse with the present invention. Although FIG.4 illustrates dimmer switch10 as a leading edge type of dimmer, alternative embodiments may includea dimmer switch 10 of a different type, (e.g., a trailing edge dimmer),or may not have any dimmer switch 10 present. Dimmer switch 10 includescomponents such as potentiometer resistor (variable resistor) 150,resistor 151, capacitors 153, 157, diac 155, triac 156, and inductor154.

Triac 156 is triggered relative to the zero crossings of the AC inputvoltage 82. When the triac 156 is triggered, it keeps conducting untilthe current passing though triac 156 goes to zero at the next zerocrossing if its load is purely resistive, like a light bulb. By changingthe phase at which triac 156 is triggered, the duty cycle of the lampinput voltage 84 can be changed. The advantage of triacs over simplevariable resistors is that they dissipate very little power as they areeither fully on or fully off. Typically triacs cause a voltage drop of1-1.5 V when it passes the load current.

The purpose of potentiometer 150 and delay capacitor 153 in a diac155/triac 156 combination is to delay the firing point of diac 155 fromthe zero crossing. The larger the resistance potentiometer 150 plusresistor 151 feeding delay capacitor 153, the longer it takes for thevoltage across capacitor 153 to rise to the point where diac 155 fires,turning on triac 156. Filter capacitor 157 and inductor 154 make asimple radio frequency interference filter, without which the circuitwould generate much interference because firing of triac 156 in themiddle of the AC phase causes fast rising current surges. Dimming input25 can be used to adjust potentiometer 150, changing the firing point ofdiac 155, thus varying lamp input voltage 84.

LED Lamp

FIG. 5 is a detailed view illustrating an example embodiment of LED lamp300. LED lamp 300 comprises bridge rectifier 310, chopping circuit 320,power converter circuit 330, dimmer control unit 340, and LEDs 302. LEDlamp 300 also includes capacitor C1 for EMI suppression.

Bridge rectifier 310 rectifies lamp input voltage 84 from dimmer switch10 and provides rectified voltage signal Vin to chopping circuit 320.Chopping circuit 320 is a switching circuit that supplies power to thepower converter 330 as supply voltage Vcb. Chopping circuit 320efficiently supplies power to power converter 330 according to switchingcontrol signal Chop_out that is generated based in part on the type ofdimmer switch 10 detected during a configuration mode of LED lamp 300described in further detail below. Chopping circuit 320 also outputssense voltage, Vin_a to dimmer control unit 340. During theconfiguration mode, dimmer control unit 340 determines the type ofdimmer switch 10 based in part on the sense voltage Vin_a. During normaloperation, dimmer control unit 340 outputs control signal Chop_out tocontrol switching of chopping circuit 320, and outputs control signalDim_control to control power converter 330. Power converter 330 drivesLEDs 302 based on Dim_control to achieve the desired dimming effect aswill be described in more detail below. Although only three LEDs 302 areillustrated, it should be understood that power converter 330 may drivean LED string having any number of LEDs, or may drive multiple stringsof LEDs 302 in parallel.

Chopping Circuit

In one embodiment, chopping circuit 320 comprises resistors R1, R2, andRc, inductor Lc, diodes D1 and D2, and switch Qc. Chopping inductor Lcis coupled in series between input voltage Vin and switch Qc for storingpower from input voltage Vin when chopping switch Qc turns on andreleasing power to the power converter when chopping switch Qc turnsoff. Diode D2 is coupled in series between chopping inductor Lc andpower converter 330, and provides power from chopping inductor Lc topower converter 330 when switch Qc turns off. Chopping resistor Rc iscoupled in series with chopping switch Qc and chopping inductor Lc anddissipates power from chopping inductor Lc when switch Qc turns on.Diode D1 is coupled between input voltage Vin and power converter 330,and charges capacitor Cb when the voltage Vcb is lower than the inputlamp voltage. Resistors R1 and R2 form a voltage divider to providesense voltage Vsense proportional to input voltage Vin.

Switch Qc is controlled by switch control signal Chop_out to turn Qc onand off in a manner that efficiently delivers supply voltage Vcb topower converter 330. As discussed above, dimmer switch 10 typicallycontains a triac device 64. However, triac device 64 contains aparasitic capacitance that, if not controlled, can deliver undesirablecurrent to power converter 330 while the triac device 64 is in theoff-state. Furthermore, capacitor C1 can deliver additional undesirablecurrent to power converter 330 while triac device 64 is in theoff-state. Such undesirable current could cause distortion of lamp inputvoltage Vin and cause LED lamp 300 to malfunction. Switch control signalChop_out controls switch Qc in order to provide a resistive load toinput voltage Vin when triac device 64 is in the off-state and dissipatethe undesired current. In one embodiment, Chop_out controls Qc to turnon during a detected estimate of the off-time Td_off of the dimmer (alsoreferred to herein as the “fire period”), thereby redirecting theundesired current through bypass resistor Rc and preventing distortionon input voltage Vin. During a detected estimate of the on-time Td_on ofthe dimmer (also referred to herein as the “chopping period”), Chop_outcontrols Qc to allow current to flow from the bridge rectifier 310through diode D2 to the power converter 330. In one embodiment, Diode D1charges capacitor Cb when the voltage Vcb is lower than the input lampvoltage Vin to help reduce the inrush current when triac 64 turns on.

In order to provide good power efficiency, switch control signalChop_out controls Qc to cyclically turn on and off during the choppingperiod according to a chopping function rather than holding Qc in theoff-state. For example, in one embodiment, the chopping period comprisesmultiple chopping cycles, where each chopping cycle i comprises anon-time Ton_Qc_(i) and off-time Toff_Qc_(i). In one embodiment, theon-time Ton_Qc_(i) of switch Qc during a chopping cycle i is given bythe following equation:

$\begin{matrix}{{Ton\_ Qc}_{i} = \frac{K\; 1}{{Vin}_{i}}} & (1)\end{matrix}$

where K1 is an experimentally determined constant, and Vin_(i) is theinput voltage Vin at the beginning of the chopping cycle i.

The off-time Toff_Qc_(i) during chopping cycle i is given by thefollowing equation:

$\begin{matrix}{{Toff\_ Qc}_{i} = {\frac{K\; 2}{{Vin}_{i}} - {Ton\_ Qc}_{i}}} & (2)\end{matrix}$

where K2 is a second experimentally determined constant. Thus, switch Qcturns on and off multiple times during the chopping period according tovarying on-times and off-times that are based on the varying inputvoltage Vin.

FIG. 6 illustrates example waveforms showing the operation of choppingcircuit 320. The waveforms are illustrated with an example input Vin_a(sensed via a voltage divider comprising resistors R1 and R2) thatfollows a leading edge dimmer type. However, chopping circuit 320operates similarly when other types of dimmers are present (e.g., atrailing edge dimmer). During the fire period, Chop_out is set high,turning on switch Qc. Inductor Lc is saturated and supplies constantcurrent which is dissipated through chopping resistor Rc. Voltage Vcbdrops during the fire period because no current flows through diode D2to power converter 330.

During the chopping period, Chop_out is turned on and off according tothe chopping functions of equations (1) and (2). As Vin increases, theon-period Ton_Qc_(i) and the off-period Toff_Qc_(i) of the controlsignal Chop_out both decrease. Thus, in one embodiment, both theon-period Ton_Qc_(i) and the off-period Toff_Qc_(i) are inverselyproportional to input voltage Vin. The chopping inductor Lc storesenergy when Qc turns on, and then releases the energy to capacitor Cbwhen Qc turns off as illustrated by the current spikes through Lc. Theenergy from inductor Lc charges capacitor Cb and voltage Vcb increases.During the chopping period, the average current of Lc is in phase withthe input AC line voltage, inherently providing a high power factor.

Power Converter

Referring back to FIG. 5, in one embodiment, power converter 330comprises a flyback converter that includes diode D3, capacitor Co,switch Q1, resistors R3, R4, and Rs, constant current controller 335,and transformer T1 having primary winding P1, secondary winding S1, andauxiliary winding A1. Constant current controller 335 generates outputdrive signal 336 that drives the switch Q1. The input power from supplyvoltage Vcb is stored in transformer T1 when switch Q1 is turned onbecause diode D3 becomes reverse biased. The input power is thentransferred to LEDs 302 across capacitor Co while switch Q1 is turnedoff because diode D3 becomes forward biased. Diode D3 functions as anoutput rectifier and capacitor Co functions as an output filter. Theresulting regulated output voltage V_LED is delivered to LEDs 302.

Constant current controller 335 generates switch control signal 336 tocontrol switch Q1 of converter 330 such that a constant current ismaintained through the LEDs 302. Constant current controller 335 canemploy any one of a number of well-known modulation techniques, such aspulse-width-modulation (PWM) or pulse-frequency-modulation (PFM), tocontrol the ON and OFF states and duty cycles of power switch Q1. PWMand PFM are conventional techniques used for controlling the switchingpower converters by controlling the widths or frequencies, respectively,of the output drive pulse 336 driving the switch Q1 to achieve outputpower regulation. Thus, constant current controller 335 generatesappropriate switch drive pulses 336 to control the on-times of powerswitch Q1 and regulate the output current through the LEDs 302.

The voltage Isense is used to sense the primary current Ip through theprimary winding P1 in the form of a voltage across sense resistor Rs.The voltage Vsense is used to sense the voltage across the auxiliarywinding A1 of transformer T1 via a resistive voltage divider comprisingresistors R3 and R4. In a flyback converter, the output current isproportional to the product of the peak voltage on the current sensingresistor Rs (represented by Isense) and the reset time of transformerT1. The reset time of the transformer T1 is the time between when switchQ1 is turned off and the falling edge of the transformer auxiliaryvoltage (represented by Vsense). Constant current controller 335implements peak current switching to limit primary current Ip by sensingthe voltage Isense and generating control signal 336 to turn off theswitch Q1 when Isense exceeds a threshold value Vipeak. Constant currentcontroller 335 also samples voltage Vsense at the end of each switchingcycle of power converter 330 to measure the reset time of thetransformer T1. Constant current regulation is maintained by adjustingthe threshold value Vipeak in inverse proportion to the measured resettime of the transformer T1 in the previous cycle. An example embodimentof constant current controller 335 is described in more detail in U.S.Pat. No. 7,443,700 entitled “On-time Control for Constant Current Modein a Flyback Power Supply”, issued on Oct. 28, 2008, the content ofwhich is hereby incorporated by reference in its entirety.

Dimmer Control Unit

FIG. 7 illustrates an embodiment of dimmer control unit 340. Dimmercontrol unit 340 comprises analog-to-digital converter (ADC) 701, dimmertype detector 712, phase detector 716, chop generator 714, and dimmingcontroller 718. Those of skill in the art will recognize that otherembodiments can have different modules than the ones described here, andthat the functionalities can be distributed among the modules in adifferent manner. In addition, the functions ascribed to the variousmodules can be performed by multiple modules.

ADC 701 receives analog signal Vin_a from chopping circuit 320 andconverts the signal Vin_a to digital signal Vin_d. As described above,input signal Vin_a (and corresponding digital signal Vin_d) isproportional to lamp input voltage Vin. Dimmer type detector 712determines the type of dimmer (indicated by D_type) during aconfiguration process as will be described in further detail below withreference to FIGS. 8-9. Phase detector 716 observes input signal Vin_dand determines the amount of phase modulation (if any) using detectionalgorithms based on D_type. Phase detector 716 outputs a detected periodTd_period and detected on-time Td_on of the dimmer switch 10. Td_periodand Td_on are used by chop generator 714 to generate chopping controlsignal Chop_out to control switching of chopping circuit 320. Td_periodand Td_on are also used by dimming controller 718 to generate controlsignal Dim_control, which is outputted to power converter 330 to achievethe desired dimming effect.

Configuration Process for Dimmer Type Detection

An example process performed by dimmer control unit 712 for determiningthe type of dimmer switch 10 is illustrated in FIG. 8. Typically, thedetection process starts 802 during a predefined configuration period ofLED lamp 300. The configuration period generally begins shortly afterthe AC power source 15 is turned on, but after enough cycles have passedso that the process is not affected by start-up noise (e.g., during the3rd AC half-cycle after start-up). Dimmer type detector 712 receives 804digital signal Vin_d. Dimmer type detector 712 then computes aderivative of Vin_d and determines 806 the maximum positive derivateMax_dl that occurs during an AC cycle. In some embodiments, dimmer typedetector 712 determines the minimum derivative Min_dl that occurs duringthe AC cycle instead of or in addition to Max_dl.

Dimmer type detector 712 computes 808 one or more adaptive thresholdvalues as a function of the maximum input voltage detected during theprevious AC cycle (Vin_max). For example, in one embodiment, theadaptive threshold value is directly proportional to Vin_max. In otheralternative embodiments, the thresholds are instead computed as afunction of the minimum filtered derivative Min_dl.

To detect a leading edge dimmer, dimmer type detector 712 compares 810Max_dl to a leading edge threshold Th_LE. Leading edge threshold Th_LEis set such that Max_dl will exceed the threshold Th_LE when aleading-edge dimmer turns on (due to the very steep leading voltage thatoccurs when a leading edge dimmer turns on), but Max_dl will not exceedthe threshold Th_LE when no dimmer is present or when a trailing edgedimmer is present (due to the more gradual leading voltage of theun-modulated AC cycle). If Max_dl exceeds the threshold Th_LE, dimmertype detector 712 determines 812 that a leading edge dimmer is detected.

If the threshold Th_LE is not exceeded, dimmer type detector 712 nextdetermines if a trailing edge dimmer is supplying input voltage Vin orif there is no dimmer switch 10 installed. In one embodiment, dimmertype detector 712 measures a time period between a time t0 and a timet1, where t0 corresponds to a time when Vin_d falls below a trailingedge threshold voltage Th_TE, and t1 corresponds to a time when Vin_drises above the trailing edge threshold voltage Th_TE. Dimmer typedetector 712 then determines 814 if the measured time period (t1−t0) isless than a time threshold Th_t. If the measured time window (t1−t0)fails to exceed the time threshold Th_t, then dimmer type detector 712determines 816 that no dimmer switch is present. Otherwise, if themeasured time window (t1−t0) exceeds the time threshold Th_t, thendimmer type detector 712 determines 818 that a trailing edge dimmer isdetected. This detection technique relies on the fact that the outputvoltage of a trailing edge dimmer drops to near zero prior to thecompletion of the AC half-cycle, and thus the input voltage Vin_d willremain below the threshold voltage Th_TE for a longer period of time(t1−t0) when a trailing edge dimmer switch is installed than when thereno dimmer switch is installed.

Some dimmers require a warm-up period before they are able to output aproper leading-edge or trailing-edge voltage waveform. To support thesedimmers, in some embodiments, dimmer type detector 712 runs one or moredimmer re-detection processes after the initial configuration period.FIG. 9 illustrates an example of a process for dimmer detection usingdimmer re-detection. The process starts 902 shortly after startup of theAC power supply 15. At AC half-cycle N1 (e.g., N1=3), dimmer typedetector 712 performs 904 a first dimmer detection process (i.e. stage 1detection) such as the process described above with reference to FIG. 8.At AC half-cycle N2 (e.g., N2=20), dimmer type detector 712 performs 906a second dimmer detection process (i.e. stage 2 detection) identical tothe stage 1 detection process. Dimmer type detector 712 then compares908 the results of the stage 1 and stage 2 detections. If the stage 1and stage 2 detection processes agree on the detected dimmer type, thenthe dimmer type determined by stage 1 and stage 2 is confirmed and theoutput D_type is set 910 to the agreed upon dimmer type. If the resultsdisagree, dimmer type detector 712 performs 912 a third detectionprocess (i.e. stage 3 detection) at AC half-cycle N3 (e.g., N3=30).Dimmer type detector 712 then compares 914 the results of the stage 2and stage 3 detections. If the detection processes agree, then thedimmer type determined by stage 2 and stage 3 is confirmed and theoutput D_type is set 916 to the agreed upon dimmer type. If the resultsdisagree, then dimmer type detector 712 determines that an unsupporteddimmer type is used and sets 918 the output D_type accordingly.

In one embodiment, LED lamp 300 enters a “safe mode” when dimmer typedetector 712 determines that the dimmer type is unsupported. In “safemode,” the LED lamp 300 may prevent the delivery of power to the LEDs302. In one embodiment, the LED lamp 300 outputs a coded signal (e.g.,in a form of a blinking pattern) to assist an end user in determiningthe proper course of action when an unsupported dimmer type is detected.

Phase Detection

Referring back to FIG. 7, Phase detector 716 determines an amount ofphase modulation applied by the dimmer switch 10 based in part on thedetermined dimmer type D_type. For example, in one embodiment, phasedetector 716 determines a detected period Td_period and detected on-timeTd_on of the dimmer. Example waveforms showing phase detection areillustrated in FIG. 10A for a leading edge dimmer type and in FIG. 10Bfor a trailing edge dimmer type. In one embodiment, phase detector 716comprises a comparator for comparing input voltage Vin_d to thresholdvalues dependent on D_type. Generally, the period Td_period starts whena leading portion of the input voltage Vin_d crosses a leading thresholdvoltage V_Le and ends at the point where a leading portion of the inputvoltage Vin_d again crosses the leading threshold voltage V_Le. Thedimmer on-time Td_on begins at the point where a leading portion of theinput voltage Vin_d crosses the leading threshold voltage V_Le and endsat the point where a trailing portion of the input voltage crosses atrailing threshold voltage V_Tr. The dimmer off-time is given asfollows:

T _(d) _(—) _(off) =T _(d) _(—) _(period) −T _(d) _(—) _(on)   (3)

When D_type indicates that no dimmer is present, only the leadingthreshold comparison is needed because the waveform is always on (i.e.Td_on=Tperiod). The thresholds voltages V_Le and V_Tr are set based onthe type of dimmer detected. When no dimmer is present, the thresholdvoltage V_Le is a function of the maximum voltage of the previous cyclegiven as follows:

V _(Le) =K ₃ ·V _(in) _(—) _(max) V _(r) =K ₃ ·V _(in) _(—) _(max)   (4)

where K3 is an experimentally determined constant. When a dimmer ispresent (leading edge or trailing edge), the leading and trailingthreshold voltages are fixed values (e.g., V_Le=53 V and V_Tr=26V).Furthermore, in one embodiment, phase detector 716 comprises a low passfilter. When a leading-edge dimmer is detected, the filter is bypassedand an unfiltered input voltage Vin_d is compared to the leadingthreshold V_Le. In all other cases, a low-pass filtered input voltage isused for threshold comparisons.

Chop generator 714 generates Chop_out signal described above using thedetected dimmer on-time Td_on and off-time Td_off. Generally, chopgenerator 714 outputs Chop_out to turn transistor Qc on during thedetected off-time Td_off of the dimmer, and switches Qc on and offaccording to a chopping function during the detected on-time Td_on ofthe dimmer, as described above with respect to equations (1) and (2).

Dimming controller 718 uses the detected dimmer on-time Td_on andoff-time Td_off to generate dimmer control signal Dim_Control. In oneembodiment, dimming controller 718 compute a dimming phase Dphase asfollows:

$\begin{matrix}{D_{phase} = \frac{T_{ON}}{T_{PERIOD}}} & (5)\end{matrix}$

Dimming controller 718 then converts the dimming phase Dphase to an LEDdimming ratio D_ratio in the range [0, 1] indicating a fraction of powerto deliver to the LEDs to achieve the desired dimming. Thus, whenD_ratio=1, the power convert 330 outputs 100% of power to the LEDs 302.When D_ratio=0.1, the power converter 330 outputs 10% of power to theLEDs 302. In one embodiment, the LED dimming ratio D_ratio is computedas follows:

D _(ratio) =D _(phase) ·K ₄ +K ₅   (6)

where K4 and K5 are experimentally determined constants based on thedifferent luminosity curves between incandescent bulbs and LEDs. Theconstants K4 and K5 are chosen such that the LED lamp 300 will behavelike an incandescent lamp in its luminosity response to the dimmingcontrol signal 25. Thus, for example, if the dimmer switch 10 is set to50% dimming, the LED lamp 300 will control current through the LEDs 302such that the LEDs output 50% of their maximum output luminosity.

Two different approaches may be used to modulate output power of theLEDs 302. In the first approach, PWM digital dimming is used, andDim_control is indicative of a duty cycle used by power converter 330 toachieve the desired dimming effect. In PWM dimming, the desired dimmingeffect is achieved by switching the LEDs 302 on and off according to aduty cycle based on the desired dimming. The perceived light intensityof the LEDs 302 is dictated by the average intensity output. In oneembodiment, power converter 330 achieves the desired dimming effect byswitching between a constant current state and an off-state. In theconstant current state (i.e. the On period), constant current controller335 turns switch Q1 on and off as described above such that a constantcurrent is maintained through LEDs 302 and the LEDs are on. In theoff-state (i.e. the Off_period), constant current controller 335 turnsswitch Q1 off and the LEDs 302 turn off. The On_period (during whichconverter 330 operates in the constant current state) is given by:

On_period=D_ratio·Dimming_period   (7)

where Dimming_period is a nominal value corresponding to maximum alloweddimming period. In the off-state, the LEDs turn off for an off-periodgiven by:

Off_period=Dimming_period−On_period   (8)

In a second approach, output power of the LEDs 302 is modulated usingamplitude dimming. In amplitude dimming, the desired dimming effect isachieved by lowering the peak current through the primary side winding,which proportionally lowers the output current of the power converter330. Thus, control signal Dim_control is indicative of a peak currentused by the power converter 330 to achieve the desired dimming effect.In this approach, the threshold signal Vipeak used by the constantcurrent controller 335 for current regulation is modulated as:

Vipeak=Vipeak_nom×Dratio   (8)

where Vipeak_nom is a nominal threshold value proportional to themaximum allowable LED current. As explained above, constant currentcontroller 335 compares the sensed voltage Isense to Vipeak and switchesQ1 off when Isense exceeds Vipeak. Thus, the dimming effect is achievedby scaling down the peak current allowed through the primary sidewinding.

Generally, the PWM dimming approach has the advantage of highefficiency, but can have the problem of flicker. The amplitude dimmingapproach does not have the flicker problem, but instead can have lowerefficiency relative to the PWM dimming approach and has a more limiteddimming range. In one embodiment, a hybrid dimming approach is thereforeused to obtain the best combination of efficiency and performance. Inthe hybrid dimming approach, dimming controller 718 outputs controlsignal Dim_control comprising a first control signal indicating amodified duty cycle (represented by On_period) and a second controlsignal indicating a modified peak current value (Vipeak) for controllingpower converter 330. In this embodiment, both On_period and Vipeak aremodulated as a function of D_ratio as follows:

On_period=f ₁(D_ratio)

Vipeak=f ₂(D_ratio)   (9)

where functions f1 and f2 are experimentally determined functions.

The LED lamps according to various embodiments of the present inventionhas the advantage that the LED lamp can be a direct replacement ofconventional incandescent lamps in typical wiring configurations foundin residential and commercial building lighting applications, and thatthe LED lamp can be used with conventional dimmer switches that carryout dimming by changing the input voltage to the lamps.

Upon reading this disclosure, those of skill in the art will appreciatestill additional alternative designs for an LED lamp. Thus, whileparticular embodiments and applications of the present invention havebeen illustrated and described, it is to be understood that theinvention is not limited to the precise construction and componentsdisclosed herein and that various modifications, changes and variationswhich will be apparent to those skilled in the art may be made in thearrangement, operation and details of the method and apparatus of thepresent invention disclosed herein without departing from the spirit andscope of the invention as defined in the appended claims.

1. A light-emitting diode (LED) lamp, comprising: one or more LEDs; adimmer control unit configured to determine a type of dimmer switchproviding an input voltage, determine a detected dimming amount of theinput voltage for the detected type of dimmer switch, and generate oneor more control signals to control regulated current through the LEDssuch that an output light intensity of the LEDs is proportional to thedetected dimming amount; and a power converter configured to receive thecontrol signals and provide regulated current to the one or more LEDs,the power converter configured to adjust the regulated current to theone or more LEDs as indicated by the control signals to achieve theoutput light intensity proportional to the detected dimming amount. 2.The LED lamp of claim 1, wherein the dimmer control unit comprises: adimmer type detector configured to receive the input voltage anddetermine the detected type of dimmer switch; a phase detectorconfigured to receive the input voltage and determine a detected phaseangle modulation of the input voltage representative of the detecteddimming amount by comparing the input voltage to one or more thresholdvoltages that are set differently depending on the detected type ofdimmer switch; and a dimming controller configured to generate thecontrol signals using the detected amount of phase angle modulation tocontrol dimming of the LEDs.
 3. The LED lamp of claim 2, wherein the oneor more dimmer control signals comprise: a first control signalindicative of a peak current for driving the LEDs, wherein the peakcurrent is a function of the detected amount of phase angle modulation,wherein the power converter drives the LEDs in a constant current modethat limits current through the converter to the peak current such thatthe light intensity of the LEDs is proportional to the detected dimmingamount.
 4. The LED lamp of claim 2, wherein the dimmer control signalscomprise: a second control signal indicative of a duty cycle for drivingthe LEDs, wherein the duty cycle is a function of the detected amount ofphase angle modulation; wherein the power converter turns the LEDs onduring an on-period of the duty cycle and the power converter turns theLEDs off during an off-period of the duty cycle such that an averagelight intensity of the LEDs is proportional to the detected dimmingamount.
 5. The LED lamp of claim 2, wherein the phase detectorcomprises: a comparator for comparing the input voltage to a leadingthreshold to determine a start of a detected on-time, and for comparingthe input voltage to a trailing threshold to determine an end of thedetected on-time, wherein the amount of phase angle modulation isdetermined from the detected on-time, and wherein the leading thresholdand the trailing threshold are set based on the detected type of dimmerswitch.
 6. The LED lamp of claim 5, wherein the leading threshold is afunction of a maximum voltage of a previous cycle when the dimmer typedetector determines that no dimmer switch is present, and wherein theleading threshold is a fixed value when the dimmer type detectordetermines that a leading edge dimmer or a falling edge dimmer isdetected.
 7. The LED lamp of claim 2, wherein the phase detectorcomprises: a low-pass filter for filtering the input voltage prior tocomparing the input voltage to the leading threshold when the detectedtype of dimmer switch is a trailing edge dimmer or when no dimmer ispresent, and wherein the low pass filter is bypassed when the detectedtype of dimmer switch is a leading edge dimmer.
 8. The LED lamp of claim1, further comprising a chopping circuit configured to dissipate powerfrom the input voltage during a detected off-time of the input voltage,and cycle between dissipating power from the input voltage and providingpower from the input voltage to the power converter during a detectedon-time of the input voltage.
 9. The LED lamp of claim 8, wherein thedimmer control unit further comprises: a chop generator circuitconfigured to generate a chopping control signal for controllingswitching of the chopping circuit such that the chopping circuitprovides power from the input voltage to the power converter during achopping on-time inversely proportional to the input voltage, anddissipates power from the input voltage during a chopping off-timeinversely proportional to the input voltage.
 10. The LED lamp of claim8, wherein the chopping circuit comprises: a chopping switch; a choppinginductor coupled in series between the input voltage and the choppingswitch, the chopping inductor for storing power from the input voltagewhen the chopping switch turns on and releasing power when the choppingswitch turns off; a chopping diode coupled in series between thechopping inductor and the power converter, the chopping diode forproviding power from the chopping inductor to the power converter whenthe chopping switch turns off; and a chopping resistor coupled in serieswith the chopping switch and the chopping inductor, the choppingresistor for dissipating power from the chopping inductor when thechopping switch turns on.
 11. The LED lamp of claim 1, wherein the powerconverter comprises a flyback power converter.
 12. The LED lamp of claim1, wherein the dimmer control unit determines the detected type ofdimmer switch during a configuration stage occurring a fixed number ofcycles after startup of the LED lamp.
 13. A method for dimming an LEDlamp, the method comprising: receiving a lamp input voltage; performinga first dimmer detection stage to determine a type of dimmer switchoutputting the lamp input voltage; determining a detecting dimmingamount of the lamp input voltage for the detected type of dimmer switch;determining control signals to drive the LED lamp based on the lampinput voltage and the detected dimming amount; and driving the LED lampbased on the control signals such that output light intensity of the LEDlamp is proportional to the detected dimming amount.
 14. The method ofclaim 13, wherein the first detection stage occurs a fixed number ofcycles after startup of the LED lamp.
 15. The method of claim 13,wherein performing the first dimmer detection stage comprises: computinga maximum derivative of the lamp input voltage during a previous cycleof the lamp input voltage; computing a first threshold value;determining if the maximum derivative exceeds the first threshold value;and responsive to the maximum derivative exceeding the first thresholdvalue, determining that the lamp input voltage is outputted from aleading edge dimmer switch.
 16. The method of claim 15, furthercomprising: computing a second threshold value; determining a timeperiod during which the lamp input voltage remains below the secondthreshold value; and responsive to the time period exceeding apredetermined time threshold, determining that the lamp input voltage isoutputted from a trailing edge dimmer switch.
 17. The method of claim16, wherein at least one of the first and second threshold values is afunction of a maximum value of the lamp input voltage during a previouscycle of the lamp input voltage.
 18. The method of claim 13, furthercomprising: performing a second dimmer detection stage a first number ofcycles after the first dimmer detection stage; responsive to thedetermined dimmer type in the first dimmer detection stage not matchingthe determined dimmer type in the second dimmer detection stage,performing a third dimmer detection stage a second number of cyclesafter the second dimmer detection stage; responsive to the determineddimmer type in the second dimmer detection stage matching the determineddimmer type in the third dimmer detection stage using the determineddimmer type in the second or third detection stage as the detected typeof dimmer; and responsive to the determined dimmer type in the seconddimmer detection stage not matching the determined dimmer type in thethird dimmer detection stage, outputting a signal indicative of anunsupported dimmer type.
 19. The method of claim 13, wherein determiningthe detected dimming amount comprises: determining a detected phaseangle modulation of the input voltage representative of the detecteddimming amount by comparing the input voltage to one or more thresholdvoltages that are set different depending on the detected type of dimmerswitch.
 20. The method of claim 19, wherein determining the detectedphase angle modulation of the lamp input voltage comprises: determininga leading threshold and a trailing threshold based at least in part onthe detected type of dimmer switch; comparing the lamp input voltage tothe leading threshold to determine a start of a detected on-time of thedimmer switch; comparing the lamp input voltage to a trailing thresholdto determine an end of the detected on-time of the dimmer switch;determining a period of the input voltage by determining a time betweentwo consecutive starts of the detected on-time; and determining thephase angle modulation of the lamp input voltage as a ratio of theon-time and the period of the dimmer switch.
 21. The method of claim 20,further comprising: applying a low-pass filter to the lamp input voltageprior to comparing the lamp input voltage to the leading thresholdresponsive to the detected dimmer type being a trailing edge dimmer orresponsive to detecting that no dimmer is present; and bypassing thelow-pass filter responsive to the detected dimmer type being a leadingedge dimmer.
 22. The method of claim 20, wherein determining the leadingthreshold comprises: setting the leading threshold to a function of amaximum voltage of a previous cycle when the dimmer type detectordetermines that no dimmer switch is present; and setting the leadingthreshold to a fixed value when the dimmer type detector determines thata leading edge dimmer or a falling edge dimmer is detected.
 23. Themethod of claim 13, wherein the determining the one or more controlsignals comprises: determining a peak current as function of thedetected dimming amount, wherein the LED lamp operates in a constantcurrent mode that limits current through the LED lamp to the peakcurrent such that the light intensity of the LED lamp is proportional tothe detected dimming amount.
 24. The method of claim 13, whereindetermining the one or more control signals comprises: determining aduty cycle as a function of the detected dimming amount, wherein the LEDlamp turns on during an on-period of the duty cycle and the LED lampturns off during an off-period of the duty cycle such that an averageoutput light intensity of the LED lamp is proportional to the detecteddimming amount.
 25. The method of claim 13, further comprising:dissipating power from the input voltage during a detected off-time ofthe input voltage, and cycling between dissipating power from the inputvoltage and providing power from the input voltage to a power converterof the LED lamp during a detected on-time of the input voltage.
 26. TheLED lamp of claim 25, wherein cycling between dissipating power from theinput voltage and providing power from the input voltage to a powerconverter comprises: providing power from the input voltage to the powerconverter during a chopping on-time inversely proportional to the inputvoltage; and dissipating power from the input voltage during a choppingoff-time inversely proportional to the input voltage.